<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>红包规则管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/enveloprule/envelopRule/?orderBy=createTime desc">红包规则列表</a></li>
		<shiro:hasPermission name="enveloprule:envelopRule:edit"><li><a href="${ctx}/enveloprule/envelopRule/form">红包规则添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="envelopRule" action="${ctx}/enveloprule/envelopRule/?orderBy=createTime desc" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>红包名称：</label>
				<form:input path="name" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>红包名称</th>
				<th>状态</th>
				<th>支持产品类型</th>
				<th>金额</th>
				<th>加息时间(天)</th>
				<th>投资期限类型(天,月)</th>
				<th>起投期限</th>
				<th>限投期限</th>
				<th>最小投资金额</th>
				<th>最大投资金额</th>
				<th>过期时间(天)</th>
				<th>创建时间</th>
				<th>修改时间</th>
				<th>扩展字段1</th>
				<th>扩展字段2</th>
				<th>扩展字段3</th>
				<shiro:hasPermission name="enveloprule:envelopRule:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="envelopRule">
			<tr>
				<td><a href="${ctx}/enveloprule/envelopRule/form?id=${envelopRule.id}">
					${envelopRule.name}
				</a></td>
				<td>${envelopRule.status == 0 ? "可用" : envelopRule.status == 1 ? "不可用" : "未知"}</td>
				<td>${envelopRule.productType == 1 ? "活期" : envelopRule.productType == 2 ? "定期" : "不限"}</td>
				<td>${envelopRule.amount}</td>
				<td>${envelopRule.activeDays}</td>
				<td>${envelopRule.investTimeType == 0 ? "天" : envelopRule.investTimeType == 1 ? "月" : "未知"}</td>
				<td>${envelopRule.minInvestTime}</td>
				<td>${envelopRule.maxInvestTime}</td>
				<td>${envelopRule.minInvestAmount}</td>
				<td>${envelopRule.maxInvestAmount}</td>
				<td>${envelopRule.expiredDays}</td>
				<td><fmt:formatDate value="${envelopRule.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td><fmt:formatDate value="${envelopRule.modifyTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td>${envelopRule.field1}</td>
				<td>${envelopRule.field2}</td>
				<td>${envelopRule.field3}</td>
				<shiro:hasPermission name="enveloprule:envelopRule:edit"><td>
    				<a href="${ctx}/enveloprule/envelopRule/form?id=${envelopRule.id}">修改</a>
					<%-- <a href="${ctx}/enveloprule/envelopRule/delete?id=${envelopRule.id}" onclick="return confirmx('确认要删除该红包规则吗？', this.href)">删除</a> --%>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>